import request from "@/utils/request";


export function findJyBycustomerId(data) {
	return request({
		url: "/api/v1/lpc/monthlyplan/findJyBycustomerId",
		method: "get",
		params: data,
	});
}

export function findJyByIds(data) {
	return request({
		url: "/api/v1/lpc/courserecord/findJyByIds",
		method: "get",
		params: data,
	});
}

export function getList(data) {
	return request({
		url: "/api/v1/lpc/monthlyplan/findPage",
		method: "get",
		params: data,
	});
}

export function getListByfind1AdnSysScheduleTimetable(data) {
	return request({
		url: "/api/v1/lpc/courserecord/getListByfind1AdnSysScheduleTimetable",
		method: "get",
		params: data,
	});
}

export function getJsonfile(data) {
	return request({
		url: "/api/v1/lpc/courserecord/getJsonfile",
		method: "get",
		params: data,
	});
}

export function getListByrenzhiqingshangAdnSysScheduleTimetableId(data) {
	return request({
		url: "/api/v1/lpc/courserecord/getListByrenzhiqingshangAdnSysScheduleTimetableId",
		method: "get",
		params: data,
	});
}

export function doInsertDoInsert(data) {
	return request({
		url: "/api/v1/lpc/courserecord/insert",
		method: "post",
		data,
		task: true
	});
}

export function doUpdate(data) {
	return request({
		url: "/api/v1/lpc/monthlyplan/update",
		method: "post",
		data,
	});
}

export function doDelete(data) {
	return request({
		url: "/api/v1/lpc/monthlyplan/del",
		method: "post",
		params: data,
	});
}

export function doDeleteAll(data) {
	return request({
		url: "/api/v1/lpc/monthlyplan/delAll",
		method: "post",
		params: data,
	});
}

/**
 * 导出Excel 目前只支持一层参数传递
 * @param data
 * @returns file
 */
export function doExportExcel(data) {
	let requestURL = "/api/v1/lpc/monthlyplan/exportExcel";
	// 下载文件
	downloadFileByData(requestURL, data);
}

/**
 * 下载模版
 * @returns file
 */
export function doDownloadTemplate() {
	let data = {};
	let requestURL = "/api/v1/lpc/monthlyplan/importExcel/template";
	// 下载文件
	downloadFileByData(requestURL, data);
}

/**
 * 导入Excel
 * @returns file
 */
export function doImportExcel(data) {
	return request({
		url: "/api/v1/lpc/monthlyplan/importExcel",
		method: "post",
		// 最长超时时间 3 分钟
		timeout: 180000,
		headers: {
			"Content-Type": "multipart/form-data",
		},
		data,
	});
}